﻿using System.Windows;
using System.Windows.Controls;
using GenericQuadTree;

namespace QuadTreeDemo
{
    public class TaxiContainer : TreeObject
    {
        public Taxi Taxi { get; private set; }

        public TaxiContainer(Point location) : base(location)
        {
            Taxi = new Taxi();
            //Shift the Canvas Left and Top properties so the center of 
            //the taxi is at the specified location.
            Taxi.SetValue(Canvas.LeftProperty, location.X - 11);
            Taxi.SetValue(Canvas.TopProperty, location.Y - 11);

            var newLocation = new Point(location.X, location.Y);
            UpdatePosition<TaxiContainer>(newLocation);
        }
    }
}